<template>
  <div class="wrapper">
    <swiper :options="swiperOption" v-if="showSwiper">
      <!-- slides -->
      <swiper-slide v-for ='item of list' :key="item.id">
        <img class="swiper-img" :src="item">
      </swiper-slide>

    </swiper>
  </div>
</template>

<script>
  export default {
    name: 'HomeSwiper',
    props:{
      list: Array
    },
    computed:{
      showSwiper(){
        return this.list.length
      }
    },
    data () {
      return {
        swiperOption: {
          autoplay:5000,
          loop: true,
        },

      }
    },
  }
</script>

<style scoped lang="stylus">
  .wrapper >>> .swiper-pagination-bullet-active
    background-color #fff !important
  .wrapper
    overflow hidden
    background-color #ddd
    height 0
    width 100%
    padding-bottom 26.7%
    .swiper-img
     width 100%
</style>
